home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 33 / 033.d81 / no-res hangman (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  13KB  |  489 lines

  1. 1 poke53280,7:poke53281,7:poke646,0:d3=1
  2. 2 printchr$(14)chr$(8)
  3. 3 dimht$(40):ht$(1)="":fori=2to40:ht$(i)=ht$(i-1)+"":next
  4. 4 ht$=chr$(145)+chr$(13)
  5. 5 dimvt$(25):vt$(0)="":fori=1to25:vt$(i)=vt$(i-1)+chr$(17):next
  6. 6 s=54272:forx=0to24:pokes+x,0:next:pokes+5,103:pokes+6,167:pokes+24,15
  7. 10 printchr$(147):goto 100
  8. 40 q=0:fa=0:sp=0:g=0
  9. 50 return
  10. 70 :
  11. 71 ht$=chr$(145)+chr$(13)
  12. 72 forpa=0to19:printvt$(1)ht$tab(19-pa)"*"vt$(1);
  13. 73 printht$tab(19+pa)"*";:next
  14. 74 forpa=1to22:printvt$(pa)ht$tab(0)"*"ht$tab(38)"*";
  15. 75 next
  16. 76 forpa=19to0step-1:printvt$(23)ht$tab(19-pa)"*";
  17. 77 printvt$(23)ht$tab(19+pa)"*";:next
  18. 78 printvt$(23);
  19. 80 :
  20. 82 return 
  21. 90 forby=21to2step-1
  22. 95 printvt$(by)"                                    "
  23. 97 next
  24. 99 return
  25. 100 :
  26. 110 dim w$(100),w(100),do$(26)
  27. 120 :
  28. 130 :
  29. 150 restore
  30. 180 fori=1to82:readw$(i):next
  31. 190 :
  32. 200 print"[147]"vt$(23);
  33. 210 fori=1to82
  34. 220 printw$(i)
  35. 230 next
  36. 235 printvt$(0)" "spc(37)" "
  37. 240 forpa=1to1500:next
  38. 250 gosub70
  39. 260 forpa=1to500:next
  40. 300 forby=21to2step-1
  41. 310 printvt$(by)"                                    "
  42. 320 :
  43. 330 next 
  44. 360 :
  45. 365 :
  46. 370 ifvq=1thenprint"[147]";:gosub70
  47. 373 vq=1
  48. 374 print"":printvt$(3)ht$tab(12)"[206]o-[210]es [200]angman"
  49. 375 printht$tab(12)"[163][163] [163][163][163] [163][163][163][163][163][163][163]"
  50. 380 printvt$(7)ht$tab(13): print "[215]hich set?"
  51. 390 printht$tab(49)"1. [210]egular list"
  52. 400 printht$tab(49)"2. [217]oung person's list"
  53. 410 printht$tab(49)"3. [208]hrase list"
  54. 415 printht$tab(49)"[211]. [211]ound effects-";:on d3 gosub453,458
  55. 420 printht$tab(49)"[209] -- [209]uit to [204]oadstar"
  56. 430 printvt$(20):printht$tab(13):print" [208]ick one: ";
  57. 440 poke198,.:wait198,1:getk$:ifk$="q"thenprint"[209]":goto10000
  58. 450 ifk$="s"thenifd3=1thend3=2:goto374
  59. 451 goto455
  60. 453 print"on[146] ":return
  61. 455 ifk$="s"thenifd3=2thend3=1:goto374
  62. 456 goto460
  63. 458 print"off[146]":return
  64. 460 ifval(k$)=.then440
  65. 470 k=val(k$):ifk>3then440
  66. 475 printk$
  67. 480 ifk$=w$(0)then570
  68. 490 w$(0)=k$:k$=""
  69. 500 open8,8,8,"t.hangtext."+w$(0)
  70. 520 input#8,w(0):fori=1tow(0)
  71. 530 input#8,w$(i):next
  72. 540 close8
  73. 550 fori=1tow(0):w(i)=i:next
  74. 560 fori=1tow(0):r1=int(rnd(1)*w(0))+1:t=w(r1):w(r1)=w(i):w(i)=t:next
  75. 570 gosub90
  76. 580 printvt$(10)ht$tab(8)"[210]emember, seven wrong"
  77. 590 printvt$(13)ht$tab(8)"guesses and you lose."
  78. 600 forpa=1to1500:next
  79. 630 forpa=1to40:next
  80. 640 :
  81. 650 :
  82. 660 printvt$(24);:print
  83. 670 foruu=1to23
  84. 680 print:ox=1:d=19-uu:gosub4000
  85. 690 :
  86. 700 next:pokes+4,16
  87. 710 if k$ <  > "" then 730
  88. 720 w(0)=w(0)+1
  89. 730 gosub40
  90. 740 w(0)=w(0)-1
  91. 741 ifw(0)=0thenprintvt$(12);:print"[149][217]ou've used all the words in this list."
  92. 742 ifw(0)=0thenprint"[149][215]e'll now return you to the main menu."
  93. 743 ifw(0)=0thenforpa=1to2000:next:w$(0)="":vq=1:goto360
  94. 750 p$=w$(w(w(0)))
  95. 755 fori=1to26:do$(i)="":next
  96. 760 print"[147]":forda=1tolen(p$)
  97. 761 ps$=mid$(p$,da,1)
  98. 765 ifps$<"a"thenprintvt$(14);:printht$tab(((2*da)+(19-len(p$))));:printps$:goto790
  99. 770 printvt$(14);:printht$tab(((2 * da) + (19 -  len (p$))));: print "[183]"
  100. 780 :
  101. 790 next 
  102. 800 forda=1tolen(p$)
  103. 810 ifmid$(p$,da,1)<>" "then820
  104. 811 printvt$(14);
  105. 815 printht$tab(((2*da)+(20-len(p$))));: print " "
  106. 816 sp=sp+1
  107. 820 ifmid$(p$,da,1)<>"-"then830
  108. 821 printvt$(14);:printht$tab(((2*da)+(20-len(p$)));
  109. 825 print" ":printvt$(13);:printht$tab(((2*da)+( 20-len(p$)));
  110. 826 print"[183]":sp=sp+1
  111. 830 ifmid$(p$,da,1)<>"'"then840
  112. 831 printvt$(14)ht$tab(((2*da)+(20-len(p$)));
  113. 835 print" ":printvt$ (13)ht$tab(((2*da)+20-len(p$)));
  114. 836 print"'":sp=sp+1
  115. 840 ifmid$(p$,da,1)<>"@"then850
  116. 841 printvt$(14)ht$tab(((2*da)+(20-len(p$))));
  117. 842 print",":sp=sp+1
  118. 850 next 
  119. 860 gosub 7080
  120. 870 printvt$(22)"                                       "
  121. 880 forpa=1to100:next
  122. 890 :
  123. 900 :
  124. 910 printvt$(22)ht$tab(13)"[199]uess a letter"
  125. 920 poke198,0:wait198,1:getl1$:ifl1$<"a"orl1$>"z"then920
  126. 930 :
  127. 931 forv=17to23:printvt$(v)ht$tab(0);
  128. 932 print"                                      ": next
  129. 940 l1=asc(l1$):l$=chr$(l1+128)
  130. 950 q=q+1
  131. 960 ifq=1then1060
  132. 970 forz=1toq-1
  133. 980 ifl$=do$(z)thenz=q:next:goto1010
  134. 990 next 
  135. 1000 goto1060
  136. 1010 :
  137. 1020 printvt$(21);
  138. 1030 printht$tab(9)"[149][217]oo-hoo, [197]instein, you": printht$tab(6);
  139. 1040 print "guessed "l$" before.  [212]ry again."
  140. 1050 goto 920
  141. 1060 forx=1tolen(p$)
  142. 1070 ifl$=mid$(p$,x,1)then1180
  143. 1080 next 
  144. 1090 do$(q)=l$
  145. 1100 ifsub=1thensub=0:goto920
  146. 1110 printvt$(20);
  147. 1120 g=g+1
  148. 1130 forpa=1to300:nextpa
  149. 1140 gosub7000
  150. 1150 ifg=7then3400
  151. 1160 printvt$(22)ht$tab(12)"[215]rong.  [212]ry again."
  152. 1170 goto920
  153. 1180 sp=sp+1
  154. 1190 fa=1
  155. 1200 gosub8000
  156. 1210 ifsp=len(p$)then3000
  157. 1220 sub=1
  158. 1230 goto1080
  159. 1240 forpa=1to40:next
  160. 3000 forv=20to23:printvt$(v)ht$tab(0)spc(38):next
  161. 3010 forpause=1to600:next
  162. 3020 ifg=0then3260
  163. 3030 ifg=1then3310
  164. 3040 printvt$(15)ht$tab(10)"[144] [207]kay, you won. [194]ut you"
  165. 3050 printvt$(17)ht$tab(12)"got   wrong first!"
  166. 3060 printvt$(19)ht$tab(8)"[195]are to try another round?"
  167. 3070 printht$tab( 57)"([217]/[206])"
  168. 3072 print"                                      "
  169. 3074 print"                                      "
  170. 3080 forpa=1to40:next
  171. 3090 ox=1:foryup=1tog
  172. 3100 forpa=1to60:next
  173. 3110 :
  174. 3120 printvt$(17)ht$tab(15)chr$(18);yup;:d=yup*2:gosub4000
  175. 3130 next:pokes+4,16
  176. 3140 printvt$(17)ht$tab(15)g;
  177. 3150 :
  178. 3160 poke198,0:wait198,1:getag$:ifag$<>"y"andag$<>"n"then3160
  179. 3165 :
  180. 3170 wi=int(rnd(1)*6)+1
  181. 3180 ifwi=p1orwi=p2orwi=p3then3170
  182. 3190 p3=p2:p2=p1:p1=wi
  183. 3200 on wi gosub 5000,5130,5260,5360,5470,5570
  184. 3220 ifag$="y"then3240
  185. 3230 goto360
  186. 3240 forwp=0to26:do$(wp)="":next
  187. 3250 goto730
  188. 3260 forv=20to23:printvt$(v)ht$tab(0);
  189. 3265 print"                                      ": next
  190. 3268 printvt$(16)ht$tab(5)"[156][193] perfect game! [201]'m impressed!"
  191. 3269 ford=23to-6step-1:ox=1:gosub4000:next:pokes+4,16:forpa=1to300:next
  192. 3270 printht$tab(6)"[201] bet you can't do it again."
  193. 3275 forpa=1to1000:next
  194. 3280 print : printht$tab(4)"[210]eady to give me another chance?"
  195. 3290 printht$tab( 57)"([217]/[206])"
  196. 3300 goto 3150
  197. 3310 printvt$(15)ht$tab( 8)"[207]nly one wrong. [206]ot bad..."
  198. 3320 ford= 23to-6step-1:ox=1:gosub4000:next:pokes+4,16:forpa=1to800:next
  199. 3330 print : printht$tab(14)"[198]or a human."
  200. 3340 forpa=1to600:next
  201. 3350 print : printht$tab( 6)"[212]he next round shall be mine."
  202. 3360 forpa=1to300:next:print
  203. 3370 printht$tab( 6)"[193]re you prepared to continue?"
  204. 3380 printht$tab(57): print "([217]/[206])"
  205. 3390 goto 3150
  206. 3400 forv=20to23:printvt$(v);:printht$tab(0);
  207. 3405 print"                                      ": next
  208. 3410 forpa=1to300:next
  209. 3420 iffa=0then3560
  210. 3430 printvt$(15)ht$tab(2)"[211]orry, but you've run out of guesses."
  211. 3440 ford=-6to23:ox=1:gosub4000:next:pokes+4,16:forpa=1to300:next
  212. 3450 print:printht$tab(8)"[200]ere's the entire word..."
  213. 3460 forpa=1to300:next
  214. 3470 forbit=1tolen(p$)
  215. 3480 :
  216. 3490 printvt$(13)ht$tab(((2*bit)+(19-len(p$))))""mid$(p$,bit,1)
  217. 3500 ox=1:d=25-bit*2:gosub4000:forpa=1to50:next
  218. 3503 printvt$(13)ht$tab(((2*bit)+(19-len(p$))))mid$(p$,bit,1)
  219. 3505 next:pokes+4,16
  220. 3510 forpause=1to1300:next
  221. 3520 iffa=0then3610
  222. 3530 printvt$(19)ht$tab(7)"[195]are to revenge your death?"
  223. 3540 printht$tab(58)"([217]/[206])"
  224. 3550 goto3150
  225. 3560 printvt$(15)ht$tab(3)"[215]ow! [206]ot even one right! [193]re you"
  226. 3570 print " sure you've plaved this game before?"
  227. 3580 ford=-6to23:ox=1:gosub4000:next:pokes+4,16:forpa=1to1000:next
  228. 3590 print:print " [193]nyway, here's what you didn't get..."
  229. 3600 goto3460
  230. 3610 forv=15to19:printvt$(v)ht$tab(0);
  231. 3615 print"                                      ": next 
  232. 3620 printvt$(15)"    [204]ook, [201] know this probably isn't"
  233. 3630 print "    a good time, what with you losing"
  234. 3640 print "     so bad, but [201] was wondering if"
  235. 3650 print "      you'd like to play again...?"
  236. 3660 goto 3540
  237. 4000 ifd3=2thenreturn
  238. 4001 d2=24-d
  239. 4005 ifox<>1 then4060
  240. 4006 ox=0
  241. 4050 pokes+4,17
  242. 4060 pokes+1,d2
  243. 4070 pokes+1,d2*4
  244. 4075 ifd<>18thenreturn
  245. 4080 pokes+4,16
  246. 4090 return
  247. 5000 :
  248. 5110 print"[147]";
  249. 5120 return 
  250. 5130 :
  251. 5140 ford1=0to12
  252. 5150 iv$=chr$(18)
  253. 5160 gosub5210
  254. 5170 iv$=""
  255. 5180 gosub5210
  256. 5190 next 
  257. 5200 return 
  258. 5210 printvt$(d1)iv$"                                       "
  259. 5230 printvt$(23-d1)iv$"                                       "
  260. 5250 return 
  261. 5260 :
  262. 5270 fori1=0to30step10
  263. 5280 fori=1to23
  264. 5290 s1$="          ":ifi1=30thens